/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package project.jpdftools.ui.actionlisteners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import project.jpdftools.constants.Const.COLOR_TYPE;
import project.jpdftools.ui.logic.JPDFText;
import project.jpdftools.ui.ColorPanel;

/**
 *
 * @author Mido
 */
public class BorderColorAction implements ActionListener {

    private Object component;

    public BorderColorAction(Object component) {
        super();
        this.component = component;
    }

    public void actionPerformed(ActionEvent evt) {
        // make sure that the component is not visible
        if (ColorPanel.IsComponentVisible() == false) {
            if (component instanceof JPDFText) {
                JPDFText text = (JPDFText) component;
                new ColorPanel(text.getScrollPane(), text, COLOR_TYPE.border_color).setVisible(true);
            }
        }
    }
}
